#include "../include/key_generator.hpp"

namespace alexcr4ckpentest
{
  KeyGenerator::KeyGenerator() noexcept
    : rand_device {}
    , mt {rand_device()}
    , get_rand_int {1, 9}
  {}

  uint64_t KeyGenerator::generate_one_key(uint8_t key_length)
  {
    buffer.str("");
    for (uint16_t i {0}; i < key_length; i++)
    {
      buffer << get_rand_int(mt);
    }
    return std::stoul(buffer.str());
  }
} // namespace alex
